from rest_framework import serializers
from .models import Already,Reserve,Users

# 已有会议

class AlreadySer(serializers.ModelSerializer):
    teacher_name = serializers.SerializerMethodField()

    def get_teacher_name(self, obj):
        return obj.name.user_name


    class Meta:
        model = Already
        fields = '__all__'

# 预约会议
class ReserveSer(serializers.ModelSerializer):
    # teacher_name = serializers.SerializerMethodField()
    #
    # def get_teacher_name(self, obj):
    #     return obj.users.user_name

    class Meta:
        model = Reserve
        fields = '__all__'





